//
//  PostalTrackerAppDelegate.h
//  PostalTracker
//
//  Created by Aleksandr Batsuev on 1/30/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <Growl/GrowlApplicationBridge.h>
#import "USPSTrackInfo.h"
#import "ContentWindow.h"
#import "NSTextFieldWithLink.h"
#import "PostalTrackerSystemMenuItemView.h"

@interface PostalTrackerAppDelegate : NSObject <NSApplicationDelegate,NSWindowDelegate,GrowlApplicationBridgeDelegate> {
	NSStatusItem *menuletMainItem;
	PostalTrackerSystemMenuItemView *menuView;
	
	USPSTrackInfo *trackInfo;
	
	IBOutlet NSView *contentView;
	
	ContentWindow *contentWindow;
	
	IBOutlet NSTextFieldWithLink *resultsField;
	IBOutlet NSSearchField *searchField;
	IBOutlet NSButton *updateButton;
	IBOutlet NSButton *detailsButton;
	IBOutlet NSButton *detailsButtonEx;
	
	NSWindow *window;
	
	NSString *lastStatus;
	NSTimer *updateTimer;
}

- (IBAction)findInfo:(id)sender;
- (void)toggleAttachedWindowAtPoint:(NSPoint)pt;
- (IBAction)showDetailedInfo:(id)sender;
- (IBAction)updateInfo:(id)sender;
- (IBAction)showAbout:(id)sender;
- (void)updateInfoFromTimer;
- (BOOL)contentWindowVisible;

@property (assign) IBOutlet NSWindow *window;

@end
